<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 创建表单
        var frm = document.createElement('form');
        document.body.appendChild(frm);
        // 创建用户名及对应的div
        var div = document.createElement('div');
        frm.appendChild(div);

        var ubox= document.createElement('input');
        ubox.placeholder='请输入用户名';
        div.appendChild(ubox);

        //创建密码及对应的div
        var div2 = document.createElement('div');
        div2.style.margin = '10px 0'
        frm.appendChild(div2);

        var passbox = document.createElement('input');
        passbox.type = 'password';
        passbox.placeholder='请输入密码';
        div2.appendChild(passbox);

        // 创建登录按钮
        var btn = document.createElement('button')
        btn.innerText = '登录';

        frm.appendChild(btn)

    </script>
</body>
</html>